package com.ll.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 2020/9/11 - 22:22
 */
//控制器类
@Controller
@RequestMapping("/user")
public class HelloController {

    @RequestMapping(path = "/hello")
    public String sayHello(){
        System.out.println("hello springMVC");
        return "success";
    }

    /**
     * @RequestMapping注解
     * @return
     */
//    @RequestMapping(value = "/testRequestMapping", method = {RequestMethod.POST})
    //params = {"username=heihei"} 设置请求参数条件,必须传username属性
    @RequestMapping(value = "/testRequestMapping", params = {"username=heihei"},headers = {"Accept"})
    public String testRequestMapping(){
        System.out.println("测试RequestMapping注解...");
        return "success";
    }
}
